import request from '@/utils/request'

// 查询商户报件列表
export function listSubmission(query) {
  return request({
    url: '/merchantSubmission/list',
    method: 'get',
    params: query
  })
}

// 查询商户报件详细
export function getSubmission(id) {
  return request({
    url: '/merchantSubmission/' + id,
    method: 'get'
  })
}

// 新增商户报件
export function addSubmission(data) {
  return request({
    url: '/merchantSubmission',
    method: 'post',
    data: data
  })
}

// 修改商户报件
export function updateSubmission(data) {
  return request({
    url: '/merchantSubmission',
    method: 'put',
    data: data
  })
}

// 删除商户报件
export function delSubmission(id) {
  return request({
    url: '/merchantSubmission/' + id,
    method: 'delete'
  })
}

// 省级数据
export function getRegionRoot(level) {
  return request({
    url: '/region/listRoot?level='+level,
    method: 'get'
  })
}

// 子级数据
export function getRegionChild(pId) {
  return request({
    url: '/region/listChild?pId='+pId,
    method: 'get'
  })
}

//上传图片
export function uploadImg(file) {
  return request({
    url: '/merchantSubmission/file',
    method: 'post',
    data: file
  })
}
